/*
 * 医务人员信息
 * @author EX-XIEYUWEN001
 * Filename:    IntegrityMedicalDescController.java
 * Copyright:   2015 中国平安保险（集团）股份有限公司 版权所有
 * Company:     平安科技养老险及健康险系统开发部
 * Create at:   2015年01月29日
 */
package com.paic.mhis.hcpms.trust.web.controller;

import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.paic.mhis.common.util.PageUtil;
import com.paic.mhis.core.auth.biz.service.UserDetails;
import com.paic.mhis.hcpms.agreement.healthcareprovider.util.HttpProcessUtil;
import com.paic.mhis.hcpms.trust.biz.service.InsuredMedicalDetailService;
import com.paic.mhis.hcpms.trust.biz.service.IntegrityArtificialScoreService;
import com.paic.mhis.hcpms.trust.biz.service.IntegrityMedicalService;
import com.paic.mhis.hcpms.trust.biz.service.IntegrityWorkFlowService;
import com.paic.mhis.hcpms.trust.dto.IntegrityMedicalDTO;
import com.paic.mhis.hcpms.trust.intergration.sao.FwaDoctorSao;
import com.paic.mhis.hcpms.trust.util.TrustConstants;
import com.paic.mhis.hcpms.trust.web.vo.IntegrityMedicalVO;
import com.paic.mhis.hcpms.trust.web.vo.TrustUtil;
import com.paic.pafa.app.biz.service.BusinessServiceException;
import com.paic.pafa.app.integration.sa.PafaSAOException;
import com.paic.pafa.appclient.annotation.BizServicesProxy;
import com.paic.pafa.exceptions.BusinessException;

@Controller
@RequestMapping("/integrityMedicalDesc/")
public class IntegrityMedicalDescController {
	@BizServicesProxy(beanName = "integrityMedicalService")
	private IntegrityMedicalService integrityMedicalService;
	@BizServicesProxy(beanName = "insuredMedicalDetailService")
	private InsuredMedicalDetailService insuredMedicalDetailService;
	@BizServicesProxy(beanName = "integrityWorkFlowService")
	IntegrityWorkFlowService integrityWorkFlowService;
	@BizServicesProxy(beanName = "integrityArtificialScoreService")
	IntegrityArtificialScoreService integrityArtificialScoreService;
	private Log log = LogFactory.getLog(this.getClass());
	@BizServicesProxy
	private FwaDoctorSao fwaDoctorSao;

	/**
	 * 医务人员详情信息
	 * 
	 * @param search
	 * @param request
	 * @return
	 * @throws BusinessException
	 */
	@RequestMapping("findIntegrityInsuranceDesc.do")
	@ResponseBody
	public Map<String, Object> findIntegrityInsuranceDesc(@ModelAttribute IntegrityMedicalVO search,
			HttpServletRequest request) throws BusinessException {
		Map<String, Object> paramMap = new HashMap<String, Object>();
		Map<String, Object> map1 = new HashMap<String, Object>();
		paramMap.put("startDate", StringUtils.isEmpty(search.getStartDate()) ? null : search.getStartDate());
		paramMap.put("endDate", StringUtils.isEmpty(search.getEndDate()) ? null : search.getEndDate());
		paramMap.put("doctorCode", StringUtils.isEmpty(search.getDoctorCode()) ? null : search.getDoctorCode());
		paramMap.put("status", StringUtils.isEmpty(search.getStatus()) ? null : search.getStatus());
		paramMap.put("taskNo", StringUtils.isEmpty(search.getTaskNo()) ? null : search.getTaskNo());
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("integrityInsurances", integrityMedicalService.findIntegrityInsuranceDesc(paramMap));
		//接口调用
		String startDate = StringUtils.isEmpty(search.getStartDate()) ? null : search.getStartDate();
		String endDate =  StringUtils.isEmpty(search.getEndDate()) ? null : search.getEndDate();
		String doctorCode = StringUtils.isEmpty(search.getCertificateNo()) ? null : search.getCertificateNo();
		try {
			map1 = fwaDoctorSao.invokeDoctorInfoESA(doctorCode, startDate, endDate);
		} catch (PafaSAOException e) {
			e.printStackTrace();
		}
		map.put("map1", map1);
		return map;
	}

	@RequestMapping("integrityDoctor.do")
	@ResponseBody
	public Map<String, Object> integrityDoctor(HttpServletRequest request) throws Exception {
		String str = HttpProcessUtil.readRequestBody(request);
		JSONObject transferJson = JSON.parseObject(str);
		String certifiNo = transferJson.getString("certifiNo");
		String certifiType = transferJson.getString("certifiType");
		Map<String, Object> paramMap = new HashMap<String, Object>();
		paramMap.put("certifiNo", certifiNo);
		paramMap.put("certifiType", certifiType);
		Map<String, Object> resultMap = new HashMap<String, Object>();
		resultMap.put("integrityDoctorInfo", insuredMedicalDetailService.queryIntegrityDoctor(paramMap));
		return resultMap;
	}

	/**
	 * 保存
	 * 
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping("saveIntegrityDoctor.do")
	@ResponseBody
	public Map<String, Object> saveIntegrityDoctor(HttpServletRequest request) throws Exception {
		String str = HttpProcessUtil.readRequestBody(request);
		UserDetails user = (UserDetails) request.getSession().getAttribute("user");
		JSONObject transferJson = JSON.parseObject(str);
		Map<String, Object> paramMap = new HashMap<String, Object>();
		Map<String, Object> resultMap = new HashMap<String, Object>();
		paramMap.put("taskNo", transferJson.getString("taskNo"));// 任务编号
		paramMap.put("status", TrustConstants.STATUS_WAIT_MODIFIED);// 当前节点状态
		paramMap.put("saveStatus", transferJson.getString("saveStatus"));// 操作状态1.保存，2.暂存
		paramMap.put("userInfo", user);// 用户对象
		resultMap = integrityWorkFlowService.resultMapIntegrityWorkFlow(transferJson, paramMap, resultMap);
		// Map<String, Object> resultMap =
		// insuredMedicalDetailService.saveIntegrityDoctor(transferJson,
		// user.getUsername());
		return resultMap;
	}

	/**
	 * 批量提交
	 * 
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping("batchArtificialScore.do")
	@ResponseBody
	public Map<String, Object> batchArtificialScore(HttpServletRequest request) throws Exception {
		String str = HttpProcessUtil.readRequestBody(request);
		UserDetails user = (UserDetails) request.getSession().getAttribute("user");
		JSONObject transferJson = JSON.parseObject(str);
		Map<String, Object> resultMap = new HashMap<String, Object>();
		resultMap = integrityArtificialScoreService.batchArtificialScore(transferJson, user);
		return resultMap;
	}

	/**
	 * 暂存
	 * 
	 * @param request
	 * @return
	 * @throws Exception
	 */

	@RequestMapping("scratchIntegrityDoctor.do")
	@ResponseBody
	public Map<String, Object> scratchIntegrityDoctor(HttpServletRequest request) throws Exception {
		String str = HttpProcessUtil.readRequestBody(request);
		UserDetails user = (UserDetails) request.getSession().getAttribute("user");
		JSONObject transferJson = JSON.parseObject(str);
		Map<String, Object> paramMap = new HashMap<String, Object>();
		String taskNo = transferJson.get("taskNo").toString();
		paramMap.put("taskNo", taskNo);
		paramMap.put("userName", user.getUsername());
		Map<String, Object> resultMap = integrityMedicalService.updateStorageSaveDatePoint(transferJson, paramMap);
		return resultMap;
	}

	/**
	 * 医务人员登记查询
	 * 
	 * @param search
	 * @param limit
	 * @param start
	 * @param request
	 * @return
	 * @throws BusinessServiceException
	 * @throws BusinessException
	 */
	@RequestMapping("insuredMedicalListAdd.do")
	@ResponseBody
	public Map<String, Object> insuredMedicalListAdd(@ModelAttribute IntegrityMedicalVO search,
			@RequestParam(value = "limit", defaultValue = "20") int limit,
			@RequestParam(value = "start", defaultValue = "0") int start, HttpServletRequest request)
			throws BusinessServiceException, BusinessException {
		Map<String, Object> result = new HashMap<String, Object>();
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		UserDetails user = (UserDetails) request.getSession().getAttribute("user");
		paramMap.put("limit", limit);
		paramMap.put("start", start);

		List<String> statusList = new ArrayList<String>();
		statusList.add(TrustConstants.STATUS_WAIT_MODIFIED);
		paramMap.put("userName", user.getUsername());
		paramMap.put("userRole", TrustConstants.INTEGRITY_MANAGE_ROLE);
		paramMap.put("statusList", statusList);
		paramMap.put("nextStatus", TrustConstants.STATUS_WAIT_AUDIT);

		TrustUtil.paramMap(paramMap, search);
		try {
			result = insuredMedicalDetailService.insuredMedicalListAdd(paramMap);
		} catch (Exception e) {
			result = HttpProcessUtil.processException(e);
		}
		return result;
	}

	/**
	 * 医务人员登记导出查询(只导出待修改的数据)
	 * 
	 * @param limit
	 * @param start
	 * @param excelName
	 * @param vo
	 * @param response
	 */
	@RequestMapping("insuredMedicalListAddExport.do")
	@ResponseBody
	public void insuredMedicalListAddExport(@RequestParam(value = "limit", defaultValue = "20") int limit,
			@RequestParam(value = "start", defaultValue = "0") int start,
			@RequestParam(value = "excelName", defaultValue = "medicalDetail") String excelName,
			@ModelAttribute IntegrityMedicalVO vo, HttpServletResponse response, HttpServletRequest request) {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		UserDetails user = (UserDetails) request.getSession().getAttribute("user");
		paramMap.put("limit", limit);
		paramMap.put("start", start);
		List<String> statusList = new ArrayList<String>();
		statusList.add(TrustConstants.STATUS_WAIT_MODIFIED);
		paramMap.put("userName", user.getUsername());
		paramMap.put("userRole", TrustConstants.INTEGRITY_MANAGE_ROLE);
		paramMap.put("statusList", statusList);
		paramMap.put("nextStatus", TrustConstants.STATUS_WAIT_AUDIT);
		TrustUtil.paramMap(paramMap, vo);
		List<IntegrityMedicalDTO> storageList = insuredMedicalDetailService.insuredMedicalListAddExport(paramMap);
		List<IntegrityMedicalDTO> tempList = insuredMedicalDetailService.insuredMedicalListAddExportTemp(paramMap);
		List<IntegrityMedicalDTO> list = new ArrayList<IntegrityMedicalDTO>();
		int storageTotal = storageList.size();
		int tempTotal = tempList.size();
		limit = 8000;
		if (storageTotal <= limit) {
			list.addAll(storageList);
		} else {
			for (int i = 0; i < storageTotal;) {
				PageUtil.assemblePageParamObject(limit, i + 1, paramMap);
				List<IntegrityMedicalDTO> resultListTemp = insuredMedicalDetailService
						.insuredMedicalListAddExport(paramMap);
				list.addAll(resultListTemp);
				i += limit;
			}
		}
		int limitTemp = 8000;
		if (tempTotal <= limitTemp) {
			list.addAll(tempList);
		} else {
			for (int i = 0; i < tempTotal;) {
				PageUtil.assemblePageParamObject(limitTemp, i + 1, paramMap);
				List<IntegrityMedicalDTO> resultListTemp = insuredMedicalDetailService
						.insuredMedicalListAddExportTemp(paramMap);
				list.addAll(resultListTemp);
				i += limitTemp;
			}

		}
		String[] str = { "序号", "医生姓名", "身份证号", "机构名称", "机构编号", "机构地址", "执业时间", "违规记分值", "案件编号", "记分原因", "案发时间",
				"暂停医保服务权限时间", "状态" };
		try {
			exportExcel(str, excelName, list, response);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private void exportExcel(String[] str, String excelName, List<IntegrityMedicalDTO> list,
			HttpServletResponse response) throws IOException {
		Workbook excel = null;
		try {
			excel = new HSSFWorkbook();
			Sheet sheet = excel.createSheet(excelName);
			Row row = sheet.createRow(0);
			// 设置Excel头
			int j = 0;
			for (String key : str) {
				row.createCell(j).setCellValue(key);
				sheet.setColumnWidth(j, 4000);
				j++;
			}
			// 设置Excel内容
			if (null != list) {
				for (int i = 0; i < list.size(); i++) {
					IntegrityMedicalDTO dto = list.get(i);
					row = sheet.createRow(i + 1);
					// 序号、医生姓名、身份证号、机构名称、机构编号、机构地址,执业时间、违规记分值、案件编号、记分原因、案发时间、暂停医保服务权限时间
					row.createCell(0).setCellValue(i + 1);// 序号
					row.createCell(1).setCellValue(dto.getName());// 医生姓名
					row.createCell(2).setCellValue(dto.getCertificateNo());// 身份证号
					row.createCell(3).setCellValue(dto.getHealthcareProviderName());// 机构名称
					row.createCell(4).setCellValue(dto.getHealthcareProviderCode());// 机构编号
					row.createCell(5).setCellValue(dto.getFullAddress());// 机构地址
					row.createCell(6).setCellValue(dto.getQualifiedDate());// 执业时间
					//row.createCell(7).setCellValue(dto.getViolationsScores());// 违规记分值
					//row.createCell(7).setCellType(HSSFCell.CELL_TYPE_NUMERIC);
					row.createCell(7).setCellType(HSSFCell.CELL_TYPE_NUMERIC);
					if(dto.getViolationsScores()!=null&&dto.getViolationsScores()!=""){
						row.getCell(7).setCellValue(Double.parseDouble(dto.getViolationsScores()));
					}
					else{
						row.getCell(7).setCellValue(Double.parseDouble("0.0"));
					}
	
					row.createCell(8).setCellValue(dto.getCaseNo());// 案件编号
					row.createCell(9).setCellValue(dto.getReason());// 记分原因
					row.createCell(10).setCellValue(dto.getHappenDate());// 案发时间
					row.createCell(11).setCellValue(dto.getSuspendPayExecutionTime());// 暂停医保服务权限时间
					row.createCell(12).setCellValue(dto.getActCurrent());// 状态
				}
			}
			initResponse(response, excelName);
			excel.write(response.getOutputStream());
		} catch (IOException e) {
			// logger.error("导出Excel是发生异常,异常原因:" + e.getMessage());
			e.printStackTrace();
		} finally {
			response.getOutputStream().flush();
			response.getOutputStream().close();
		}
	}

	private void initResponse(HttpServletResponse response, String excelName) {
		try {
			response.addHeader("Pragma", "no-cache");
			response.addHeader("Cache-Control", "no-cache");
			response.reset();
			response.setContentType("APPLICATION/OCTET-STREAM");
			String fileName = new String((excelName).getBytes("utf-8"), "ISO8859-1") + ".xls";
			response.setHeader("content-disposition", "attachment;fileName=\"" + fileName + "\"");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
	}

	/***
	 * 医务人员撤回
	 * 
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping("backIntegrityDoctorProcess.do")
	@ResponseBody
	public Map<String, Object> backWarnProcess(HttpServletRequest request) throws Exception {
		Map<String, Object> result = new HashMap<String, Object>();
		// 获取参数
		UserDetails user = (UserDetails) request.getSession().getAttribute("user");
		String taskNo = request.getParameter("taskNo");
		String status = request.getParameter("status");
		try {
			result = integrityArtificialScoreService.backWarnProcess(taskNo, status, user);
		} catch (Exception e) {
			result = HttpProcessUtil.processException(e);
		}
		return result;
	}

	/**
	 * 医务人员修改
	 */
	// IntegrityMedicalService
	// private List<PointCutDTO> getPointCutTempStorages(Map<String, Object>
	// paramMap, List<PointCutDTO> pointCutTemps) {
	// String caseType = (String) paramMap.get("caseType");
	// String caseNo = (String) paramMap.get("caseNo");
	// String userName = (String) paramMap.get("userName");
	/**
	 * 
	 * 查询扣分信息
	 * 
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping("integrityArtificialScoreInfo.do")
	@ResponseBody
	public Map<String, Object> integrityArtificialScoreInfo(HttpServletRequest request) {
		Map<String, Object> result = new HashMap<String, Object>();
		UserDetails user = (UserDetails) request.getSession().getAttribute("user");
		String taskNo = request.getParameter("taskNo");
		try {
			result = integrityArtificialScoreService.integrityArtificialScoreInfo(taskNo, user);
		} catch (Exception e) {
			result = HttpProcessUtil.processException(e);
		}
		return result;
	}

	// /**
	// *
	// * @param request
	// * @param response
	// */
	// @RequestMapping("exportIntegrityIllegalToCsv.do")
	// @ResponseBody
	// public void exportIntegrityIllegalToCsv(HttpServletRequest request,
	// HttpServletResponse response) {
	// Map<String, Object> map = new HashMap<String, Object>();
	// map.put("targetCode", request.getParameter("doctorCode"));
	// map.put("startDate", request.getParameter("startDate"));
	// map.put("endDate", request.getParameter("endDate"));
	// map.put("orgName", request.getParameter("doctorName"));
	// try {
	// // File resultFile =
	// // insuredMedicalDetailService.exportIntegrityIllegalToCsv(map);
	// String resultFile =
	// insuredMedicalDetailService.exportIntegrityIllegalToCsv(map);
	// response.reset();
	// response.addHeader("Pragma", "no-cache");
	// response.addHeader("Cache-Control", "no-cache");
	// response.setContentType("APPLICATION/OCTET-STREAM");
	// String name = map.get("orgName").toString() + "FWA审核情况";
	// String fileName = new String(name.getBytes("utf-8"), "ISO8859-1") +
	// ".xls";
	// response.setHeader("content-disposition", "attachment;fileName=\"" +
	// fileName + "\"");
	// OutputStream os = response.getOutputStream();
	// // FileInputStream in = new FileInputStream(resultFile);
	// // byte[] buffer = new byte[2048];
	// byte[] buffer = resultFile.getBytes();
	// // while (in.read(buffer) != -1) {
	// os.write(buffer);
	// os.flush();
	// // }
	// os.close();
	// // resultFile.delete();
	// } catch (Exception e) {
	// e.printStackTrace();
	// }
	// }

	/**
	 * 
	 * @param request
	 * @param response
	 */
	@RequestMapping("exportIntegrityIllegalToCsv.do")
	@ResponseBody
	public void exportIntegrityIllegalToCsv(HttpServletRequest request, HttpServletResponse response) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("targetCode", request.getParameter("doctorCode"));
		map.put("startDate", request.getParameter("startDate"));
		map.put("endDate", request.getParameter("endDate"));
		map.put("orgName", request.getParameter("doctorName"));
		try {
			// File resultFile =
			// insuredMedicalDetailService.exportIntegrityIllegalToCsv(map);
			// String resultFile =
			// insuredMedicalDetailService.exportIntegrityIllegalToCsv(map);
			// Map<String, Object> warnResultMap =
			// insuredMedicalDetailService.queryIntegrityIllegal(map);
			// @SuppressWarnings("unchecked")
			// Map<String, Object> warnData = (Map<String, Object>)
			// warnResultMap.get("warnData");
			// @SuppressWarnings("unchecked")
			// Map<String, Object> auditData = (Map<String, Object>)
			// warnResultMap.get("auditData");
			String name = map.get("orgName").toString() + "FWA审核情况";
			exportExcel(map, name, response);
			// response.reset();
			// response.addHeader("Pragma", "no-cache");
			// response.addHeader("Cache-Control", "no-cache");
			// response.setContentType("APPLICATION/OCTET-STREAM");
			// String name = map.get("orgName").toString() + "FWA审核情况";
			// String fileName = new String(name.getBytes("utf-8"), "ISO8859-1")
			// + ".xls";
			// response.setHeader("content-disposition",
			// "attachment;fileName=\"" + fileName + "\"");
			OutputStream os = response.getOutputStream();
			// FileInputStream in = new FileInputStream(resultFile);
			// byte[] buffer = new byte[2048];
			// byte[] buffer = resultFile.getBytes();
			// while (in.read(buffer) != -1) {
			// os.write(buffer);
			// os.flush();
			// }
			// os.close();
			// resultFile.delete();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	private void exportExcel(Map<String, Object> map, String excelName, HttpServletResponse response)
			throws IOException {
		Map<String, Object> warnResultMap = insuredMedicalDetailService.queryIntegrityIllegal(map);
		@SuppressWarnings("unchecked")
		Map<String, Object> warnData = (Map<String, Object>) warnResultMap.get("warnData");
		@SuppressWarnings("unchecked")
		Map<String, Object> auditData = (Map<String, Object>) warnResultMap.get("auditData");

		Workbook excel = null;
		try {
			excel = new HSSFWorkbook();
			Sheet sheet = excel.createSheet(excelName);
			CellStyle style = excel.createCellStyle();

			style.setAlignment(HSSFCellStyle.ALIGN_RIGHT); // 创建一个居中格式
			Row row = sheet.createRow(0);
			// 设置Excel头
			int j = 0;
			row.createCell(j).setCellValue(map.get("orgName") + "违规情况:");
			sheet.setColumnWidth(j, 4000);
			// 设置Excel内容
			String warnCount = warnData.get("num") == null ? "0" : warnData.get("num").toString();
			row = sheet.createRow(2);
			row.createCell(1).setCellValue("1、预警次数：");
			row.createCell(3).setCellValue(warnCount + "次");
			String amount = warnData.get("money") == null ? "0" : warnData.get("money").toString();
			row.createCell(5).setCellValue("涉及金额:");
			row.createCell(6).setCellValue(amount);
			row.createCell(7).setCellValue("元");
			List<Map<String, Object>> list = (List<Map<String, Object>>) warnData.get("list");
			for (int i = 0; i < list.size(); i++) {
				HashMap<String, Object> tempMap = (HashMap<String, Object>) list.get(i);
				String tempName = (String) tempMap.get("name");
				String tempCount = tempMap.get("num") == null ? "0" : tempMap.get("num").toString();
				String tempMoney = tempMap.get("money") == null ? "0" : tempMap.get("money").toString();
				row = sheet.createRow(3 + i);
				if (i == 0) {
					row.createCell(0).setCellValue("其中:");
				}
				row.createCell(1).setCellValue(tempName + ":");
				row.createCell(2).setCellValue(tempCount + "次");
				row.createCell(4).setCellValue("涉及金额:");
				row.createCell(5).setCellValue(tempMoney);
				row.createCell(6).setCellValue("元");

			}
			String auditCount = auditData.get("num") == null ? "0" : auditData.get("num").toString();
			String auditamount = auditData.get("money") == null ? "0" : auditData.get("money").toString();
			row = sheet.createRow(9);
			row.createCell(1).setCellValue("2、稽核次数:");
			row.createCell(3).setCellValue(auditCount + "次");
			row.createCell(5).setCellValue("涉及金额:");
			row.createCell(6).setCellValue(auditamount);
			row.createCell(7).setCellValue("元");

			row = sheet.createRow(11);
			row.createCell(1).setCellValue("3、其中一次记十二分:");
			row.createCell(3).setCellValue("(填充数据)" + "次");

			row = sheet.createRow(13);
			row.createCell(1).setCellValue("4、FWA事后审核情况:");

			row = sheet.createRow(14);

			row.createCell(2).setCellValue("单据数:");
			row.createCell(3).setCellValue("0条");
			row.createCell(5).setCellValue("涉及金额:");
			row.createCell(6).setCellValue("0");
			row.createCell(7).setCellValue("元");

			row = sheet.createRow(15);
			row.createCell(1).setCellValue("其中:");
			row.createCell(2).setCellValue("可疑:");
			row.createCell(3).setCellValue("0条");
			row.createCell(5).setCellValue("涉及金额:");
			row.createCell(6).setCellValue("0");
			row.createCell(7).setCellValue("元");

			row = sheet.createRow(16);
			row.createCell(2).setCellValue("高度可疑:");
			row.createCell(3).setCellValue("0条");
			row.createCell(5).setCellValue("涉及金额:");
			row.createCell(6).setCellValue("0");
			row.createCell(7).setCellValue("元");

			row = sheet.createRow(17);
			row.createCell(2).setCellValue("违规:");
			row.createCell(3).setCellValue("0条");
			row.createCell(5).setCellValue("涉及金额:");
			row.createCell(6).setCellValue("0");
			row.createCell(7).setCellValue("元");

			// Map dto = (Map) resultList.get(i);
			// row = sheet.createRow(i + 1);
			// row.createCell(0).setCellValue((String) dto.get("name"));

			initResponse(response, excelName);
			excel.write(response.getOutputStream());
		} catch (IOException e) {
			log.error("导出Excel是发生异常,异常原因:" + e.getMessage());
			e.printStackTrace();
		} finally {
			response.getOutputStream().flush();
			response.getOutputStream().close();

		}

	}
}
